package com.rd.student.jiaji.class3.sunguowei.Questions;

import java.util.Scanner;

public class first {
    public static void main(String[] args) {
        System.out.println("请输入金字塔的层数:");
        Scanner scanner = new Scanner(System.in);
        int p = scanner.nextInt();



        for (int i = 0; i <= p; i++) {
            for(int b=0;b<p-i;b++){
                System.out.print(" ");
            }
            for (int a = 0; a < 2*i-1; a++) {
                System.out.print("*");

            }

            System.out.println();
        }
//            System.out.println();
    }
}
